#include <iostream>
#include <ctime>
using namespace std;

const int N = 1e5 + 10; 

int a[N],n;

int get_random(int le,int ri){
	return a[rand() % (ri - le + 1) + le];
}

void Qusort(int le,int ri){
	if(le >= ri)return ;
	int p = get_random(le,ri);
	int l = le - 1,i = le,r = ri + 1;
	while(i < r){
		if(a[i] < p){
			swap(a[++l],a[i++]);
		}
		else if(a[i] == p)i++;
		else swap(a[--r],a[i]);
	}
	Qusort(le,l);
	Qusort(r,ri);
}

int main(){
	srand(time(0));
	cin >> n;
	for(int i = 1;i <= n;i++){
		cin >> a[i];
	}
	Qusort(1,n);
	for(int i = 1;i <= n;i++){
		cout << a[i] << " ";
	}
}
